<?php
/* *
 * 功能：用户列表
 * 日期：2016-02-17
 * 源码来自：资源e站（Zye.cc）
 */
?>
<?php
$mod='blank';
include("../includes/common.php");
$title='公告配置';
$plus = true;
include './head.php';
if($islogin==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
?>
  <nav class="navbar navbar-fixed-top navbar-default">
    <div class="container">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
          <span class="sr-only">导航按钮</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="./">后台管理</a>
      </div><!-- /.navbar-header -->
      <div id="navbar" class="collapse navbar-collapse">
        <ul class="nav navbar-nav navbar-right">
          <li>
            <a href="./"><span class="glyphicon glyphicon-user"></span> 平台首页</a>
          </li>
		  <li>
            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-cloud"></span> 用户管理<b class="caret"></b></a>
            <ul class="dropdown-menu">
              <li><a href="./dl.php">用户列表</a></li>
			  <li><a href="./search.php">搜索用户</a><li>
            </ul>
          </li>
		  <li><a href="./log.php"><span class="glyphicon glyphicon-calendar"></span> 日志查看</a></li>
		  <li><a href="../"><span class="glyphicon glyphicon-home"></span> 返回首页</a></li>
          <?php require_once('nav.php'); ?><li><a href="./login.php?logout"><span class="glyphicon glyphicon-log-out"></span> 退出登录</a></li>
        </ul>
      </div><!-- /.navbar-collapse -->
    </div><!-- /.container -->
  </nav><!-- /.navbar -->
  <div class="container" style="padding-top:70px;">
    <div class="col-sm-12 col-md-10 center-block" style="float: none;">
    <?php
	if($_POST['type']=="gg"){
		foreach($_POST as $k=> $value){
			if($k=='type')continue;
			$DB->query("insert into tell_configs set k='".daddslashes($k)."',v='".daddslashes($value)."' on duplicate key update v='".daddslashes($value)."'");
		}
		exit("<script>alert('更改成功');history.go(-1);</script>");
		
		}
	
	?>
    <div class="panel panel-primary">
        <div class="panel-heading"><h3 class="panel-title">公告配置</h3></div>
        <div class="panel-body">
          <form action="" method="post" class="form-horizontal" role="form">
          <input type="hidden" name="type" value="gg" />
          	<div class="input-group">
              <span class="input-group-addon">公告</span>
			  <textarea class="form-control" name="gg" rows="5"><?=stripslashes($conf['gg'])?></textarea>
            </div><br/>
            <div class="input-group">
              <span class="input-group-addon">底部公告</span>
			  <textarea class="form-control" name="dgg" rows="5"><?=stripslashes($conf['dgg'])?></textarea>
            </div><br/>
            <div class="input-group">
              <span class="input-group-addon">呼叫中心公告</span>
			  <textarea class="form-control" name="zgg" rows="5"><?=stripslashes($conf['zgg'])?></textarea>
            </div><br/>
            <div class="form-group">
              <div class="col-sm-12"><input type="submit" name="submit" value="修改" class="btn btn-primary form-control"/></div>
            </div>
          </form>
        </div>
      </div>
    </div>
</div>
</div>